Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not assume discriminator is not a property #1811

Merged

Conversation

lecko-cngroup
Copy link
Contributor

@lecko-cngroup lecko-cngroup commented Sep 24, 2024

Description

We happen to have property named discriminator in few of our models. This PR prevents KeyError: 'propertyName' since the schema generation code incorrectly assumes discriminator is keyword used to specify propertyName.

Type of change

Please delete options that are not relevant.

  • Bug fix (a non-breaking change that resolves an issue)

Copy link
Member

@Lancetnik Lancetnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ecko-cn group thank you for the PR? Can you please add simple test with your case to tests/async_api to be sure that this behavior fixed for the future refactoring? Anybody can remove id by accident without tests restriction

@Lancetnik Lancetnik added the bug Something isn't working label Sep 24, 2024
@Lancetnik
Copy link
Member

Btw, I am planning to make a release tomorrow evening. It will be great to see your fix in it.

@lecko-cngroup
Copy link
Contributor Author

@Lancetnik I guess these 2 new tests should be enough, right?

@Lancetnik Lancetnik enabled auto-merge September 25, 2024 15:53
@Lancetnik Lancetnik added this pull request to the merge queue Sep 25, 2024
Merged via the queue into airtai:main with commit f3cdffd Sep 25, 2024
30 checks passed
@lecko-cngroup lecko-cngroup deleted the fix-incorrect-discriminator-assumtion branch September 26, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants